Builder

class Builder<V : Any>

Builds a ValidatedIdentifierMap

Not strictly necessary, but may make construction cleaner.

Author

fzzyhmstrs

Since

0.2.0

Parameters

V

value type. any non-null type

Samples

import me.fzzyhmstrs.fzzy_config.util.Translatable
import me.fzzyhmstrs.fzzy_config.validation.collection.ValidatedEnumMap
import me.fzzyhmstrs.fzzy_config.validation.collection.ValidatedIdentifierMap
import me.fzzyhmstrs.fzzy_config.validation.collection.ValidatedStringMap
import me.fzzyhmstrs.fzzy_config.validation.minecraft.ValidatedIdentifier
import me.fzzyhmstrs.fzzy_config.validation.misc.ValidatedBoolean
import me.fzzyhmstrs.fzzy_config.validation.misc.ValidatedString
import me.fzzyhmstrs.fzzy_config.validation.number.ValidatedFloat
import me.fzzyhmstrs.fzzy_config.validation.number.ValidatedInt
import net.minecraft.registry.tag.ItemTags
import net.minecraft.util.Identifier
import java.util.*

fun main() { 
   //sampleStart 
   // a ValidatedIdentifierMap built with the builder
// keyhandler uses a ValidatedIdentifier to validate key inputs
// valuehandler takes any Entry, in this case a ValidatedBoolean (Shorthand!)
// defaults includes the default map. In this case an empty map.
val idTest: ValidatedIdentifierMap<Boolean> =
    ValidatedIdentifierMap.Builder<Boolean>()
        .keyHandler(ValidatedIdentifier.ofTag(ItemTags.BOATS))
        .valueHandler(ValidatedBoolean())
        .defaults(mapOf())
        .build() 
   //sampleEnd
}

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Functions

Link copied to clipboard

Defines the ValidatedIdentifier used to handle validation, serialization, etc. for map keys